﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using QuestionSetLibrary;
namespace JsonDataWebApplication
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "DataService" in code, svc and config file together.
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
    public class GetQuestion : IQuestion
    {
        //public QuestionSet GetOneQuestion(string id)
        //{
        //    // lookup person with the requested id 
        //    return new QuestionSet()
        //    {
        //        id = Convert.ToInt32(id),
        //        questionSetName = "First Question Set"
        //    };
        //}

        public Question[] GetAllQuestion()
        {
            var tempList = new List<Question>();

            //for (int i = 0; i < 10; i++)   //i < 10 replace with the number of question in the current question set
            //{
            //    var p = new QuestionSet()
            //    {
            //        id = Convert.ToInt32(i),
            //        questionSetName = "All Question Set"
            //    };
            //    tempList.Add(p);
            //}
            return tempList.ToArray();
        }
    }
}
